package problems

import static org.junit.Assert.assertTrue

import org.junit.Test
import org.junit.experimental.theories.DataPoints
import org.junit.experimental.theories.Theories
import org.junit.experimental.theories.Theory
import org.junit.runner.RunWith

import static org.hamcrest.Matchers.*
import static org.hamcrest.CoreMatchers.*
import static org.hamcrest.MatcherAssert.*

@RunWith(Theories.class)
class MultipleTest {
	
	@DataPoints public static int[] NUMBERS = new EulersSolutions().numberList.toArray()
	
	
		
	@Theory
	void whenWeGetAListOfAllNumbersAllNumbersAreAMultipleOf3Or5AndAreLessThen1000 (int number) {
		  assertThat number, is(both(greaterThan(0)).and(lessThan(1000)))
		  assertTrue number % 3 == 0 || number % 5 == 0
		  assertThat NUMBERS.size(), is(466)
	}
	
	@Test
	void whenWeListAllNaturalsBelow10ThatAreMultiplesOf3And5WeGet3_5_6_9AndASumOf23 () {
		def list = new EulersSolutions().getNumbersBelow(10)
		assertThat list, hasItems(3,5,6,9)
		assertThat list.sum(), is(23)
	}
	
	@Test
	void whenWeListAllNaturalsBelow1000ThatAreMultiplesOf3And5WeGetASumOf23 () {
		def list = new EulersSolutions().getNumbersBelow(1000)
		assertThat list.sum(), is(233168)
	}

}
